<?php

use app\adminapi\middleware\JwtAuth;
use app\adminapi\middleware\OperateLog;
use app\adminapi\middleware\CheckPermission;
use think\facade\Route;

// 文件路由
Route::group('file_upload', function () {
    Route::get('index', 'file.FileUploads/index')->name('file_upload:list')->setOption('real_name', '获取文件列表');
    Route::put('update/:id', 'file.FileUploads/update')->name('file_upload:update')->setOption('real_name', '编辑文件');
    Route::post('delete', 'file.FileUploads/delete')->name('file_upload:delete')->setOption('real_name', '删除文件');
    Route::post('upload', 'file.FileUploads/upload')->name('file_upload:upload')->setOption('real_name', '上传文件');
    Route::post('move', 'file.FileUploads/move')->name('file_upload:move')->setOption('real_name', '移动文件');
})->middleware([JwtAuth::class, CheckPermission::class, OperateLog::class]);

// 文件分类路由
Route::group('file_cate', function () {
    Route::get('index', 'file.FileCate/index')->name('file_cate:list')->setOption('real_name', '获取文件分类列表');
    Route::get('read/:id', 'file.FileCate/read')->name('file_cate:detail')->setOption('real_name', '获取文件分类详情');
    Route::post('save', 'file.FileCate/save')->name('file_cate:add')->setOption('real_name', '添加文件分类');
    Route::put('update/:id', 'file.FileCate/update')->name('file_cate:update')->setOption('real_name', '编辑文件分类');
    Route::delete('delete/:id', 'file.FileCate/delete')->name('file_cate:delete')->setOption('real_name', '删除文件分类');
})->middleware([JwtAuth::class, CheckPermission::class, OperateLog::class]);